1. Technical Field
The present invention relates in general to microprocessors and, in particular, to tracing an instruction stream of a microprocessor. Still more particularly, the present invention relates to tracing the count register of a microprocessor to assess the execution of a repeat instruction.
2. Description of the Related Art
In analyzing the performance of a data processing system or the applications executing within the data processing system, it is helpful to understand the execution flows and the use of system resources. An instruction trace may include a listing of the instructions executed by a processor while an application or system program is running. Instruction traces are analyzed to create performance models and to statistically monitor portions of system behavior. Dynamic usage of instruction types and other fields, address translation and memory reference patterns, and branch behavior and basic block sizes are among the many subjects of trace analysis. The extracted statistics reflect the behavior of the particular combination of architecture, implementation, system software, and application program from which the trace was collected, and so can be used to guide design decisions by developers of all of these components.
In particular, a trace may contain various levels of information. An address trace, for example, contains the sequence of memory addresses used to access instructions and operands. An instruction trace contains instruction op-codes and register specifiers in addition to the sequence of memory addresses.
Conventional tracing tools may use hardware, software, or a combination of hardware and software to obtain traces. On the hardware side, many processors include modes that allow for tracing. A focus of current processors is a branch tracing feature which causes an interrupt on detection of a taken branch instruction and traces the taken branch instruction. Gathering information about which branch instructions are most often taken and which branches are most often the exception, is useful information.
While tracing tools have focused on tracing branches and exceptions, gathering traces on the execution of other types of instructions would be advantageous. In particular, it would be advantageous to monitor the executions of repeat instructions, such as repeat string instructions. For example, it would be advantageous to monitor whether an instruction was repeated the requested number of times or whether an interrupt stopped the repeat cycle. By tracing a repeat instruction, the speed at which repeat instructions are executed may be monitored.
Therefore, it would be advantageous to have hardware and software tracing tools for monitoring and examining repeat instructions to determine the impact of repeat instructions on software performance. Further, it would be advantageous to trace both repeat and branch instructions.